<?
if (!defined('i-Teck') && !defined('i-Teck_ADMIN')) die("Hacking attempt");

function danhmuc()
{
	$danhmuc=mysql_query("SELECT * FROM danhmuc ORDER BY Id asc");
		while($rdm=mysql_fetch_array($danhmuc)){ ?>
		<H3><SPAN><?=$rdm['Name'];?></SPAN></H3>
			<DIV class=boxIndent>
				<DIV style="Z-INDEX: 0; POSITION: relative"></DIV>
					<UL class=level1>
						<? theloai($rdm['Id']) ?>
					</UL>
			</DIV>
		<?}

}


function theloai($id)
{
	$theloai=mysql_query("SELECT * FROM loaithe WHERE iddm = ".$id." ORDER BY Id asc");
		while($rtheloai=mysql_fetch_array($theloai))
			{ ?>
				<LI class="level1 item1">
					<A class="level1 item1" title="<?=$rtheloai['Name'];?>" href="https://www.THENAP.VN/vn/topup.html" target=_self>
						<SPAN><?=$rtheloai['Name'];?></SPAN>
					</A>
				</LI>
		<?}

}












function leftnews()
{
	$result3=mysql_query("SELECT * FROM shop_leftnews Where hienthi=1 ORDER BY id desc limit 2");
		while($r3=mysql_fetch_array($result3)){ ?>
		<DIV class=block>
		<DIV class=block-border>
		<DIV class=block-content>
		<DIV class="widget">
		<DIV class=widgetcontent><div style="height:320px;">
								<div class="box-boxgrid-container">
									<div class="boxgrid2 caption2">
											<a href="<?=$r3['url'];?>"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width="218px" height="320px"></a>
										<div class="cover boxcaption2" style="top: 260px; ">
										<div style="padding : 2px;"><h4><A href="<?=$r3['url'];?>"><?=stripslashes($r3["noidung"]);?></A></h4></div>
										</div>		
									</div>
								</div></div>
		</DIV></DIV><!-- end .widget -->		
		</DIV><!-- end .block-content -->
		</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
		<?}

}


function top1sp()
{
	$result3=mysql_query("SELECT * FROM shop_news Where hienthi=1 ORDER BY id desc limit 1");
		while($r3=mysql_fetch_array($result3)){
					?>
					<DIV class=slidetop>
						<A href="<?=$r3["url"];?>">
							<IMG class=thumb alt="<?=stripslashes($r3["tieude"]);?>" src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width=700 height=418>
						</A>
					</DIV><!-- end .slidetop -->
					<?}
}

function top1()
{
	$result3=mysql_query("SELECT * FROM shop_news Where hienthi=1 ORDER BY id desc limit 1");
		while($r3=mysql_fetch_array($result3)){
					?>
					<DIV class=slidetop>
						<A href="<?=$r3["url"];?>">
							<IMG class=thumb alt="<?=stripslashes($r3["tieude"]);?>" src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width=476 height=325>
						</A>
					</DIV><!-- end .slidetop -->
					<DIV class=infocenter>
						<p class="tit"><A href="<?=$r3["url"];?>"><?=stripslashes($r3["tieude"]);?></A></p>
						<p class="noidung"><?=stripslashes($r3["noidung"]);?></p>
					</DIV><!-- end .infocenter -->
					<?}
}

function tinnhanh()
{
	$result3=mysql_query("SELECT * FROM shop_tinnhanh Where hienthi=1 ORDER BY id desc limit 6");
		while($r3=mysql_fetch_array($result3)){
					?>
		<p><?=stripslashes($r3["noidung"]);?></p>
		<?}

}



function menu($string)
{
	$result3=mysql_query("SELECT * FROM shop_menu ORDER BY stt asc");
		while($r3=mysql_fetch_array($result3)){
			$a = explode("=",$r3['url']);
			if($string==$a[1])   {?>
				<LI id=menu-item-<?=$r3["id"];?> class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-<?=$r3["id"];?>">
                                    <A href="<?=$r3['url'];?>"><?=$r3['name'];?> </A>
                                </LI>				
		<?  } else{ ?>
				<LI id=menu-item-<?=$r3["id"];?> class="menu-item menu-item-type-post_type menu-item-object-page menu-item-<?=$r3["id"];?>">
                                    <A href="<?=$r3['url'];?>"><?=$r3['name'];?> </A>
                                </LI>
		<?}
		}
}


function menu1($string)
{
	$result3=mysql_query("SELECT * FROM shop_menu ORDER BY stt asc limit 3");
	$i=0;
		while($r3=mysql_fetch_array($result3)){ $i++;
			$a = explode("=",$r3['url']);
			if($a[1]==""):$a="home";endif;
			if($a[1]!="" && $string==$a[1])
			{
				$active='selected';
			}
			else
			{
				$active='';
			}
			if($r3['stt']==0){?>
					<li class="hd_first <?=$active;?>"><a href="<?=$r3['url'];?>" class="nav_01"><?=$r3['name'];?><em></em></a></li>
					<? } elseif($r3['stt']==1){?>
					<li class="<?=$active;?>"><a href="<?=$r3['url'];?>" class="nav_02"><?=$r3['name'];?><em></em></a></li>
					<? } elseif($r3['stt']==2){?>
					<li class="<?=$active;?>"><a href="<?=$r3['url'];?>" class="nav_05"><?=$r3['name'];?><em></em></a></li>
		<?}
		}
}



function menu2($string)
{
	$result4=mysql_query("SELECT  * FROM shop_menu ORDER BY stt ASC");
	$i=0;
		while($r4=mysql_fetch_array($result4)){ $i++;
			$a = explode("=",$r4['url']);
			if($a[1]!="" && $string==$a[1])
			{
				$active='selected';
			}
			else
			{
				$active='';
			}
			if($r4['stt']==3){?>
					<li class=" <?=$active;?>"><a href="<?=$r4['url'];?>" class="nav_06"><?=$r4['name'];?><em></em></a></li>
					<? } elseif($r4['stt']==4){?>
					<li class="<?=$active;?>"><a href="<?=$r4['url'];?>" class="nav_03"><?=$r4['name'];?><em></em></a></li>
					<? } elseif($r4['stt']==5){?>
					<li class="hd-last <?=$active;?>"><a href="<?=$r4['url'];?>" class="nav_04"><?=$r4['name'];?><em></em></a></li>
		<?}
			
			}
}



function menusp()
{
	$result3=mysql_query("SELECT * FROM `shop_trademarks` ORDER BY stt asc");
		while($r3=mysql_fetch_array($result3)){
?>				<LI id=menu-item-<?=$r3["id"];?> class="menu-item menu-item-type-post_type menu-item-object-page menu-item-<?=$r3["id"];?>">
                                    <A href="<?=m_get_config('web_url')."/viewproducts.php?mode=all&id=".$r3['id']."&name=".khongdau($r3['name']);?>"><?=$r3['name'];?> </A>
                                </LI>
		<?}
}




function catag()
{
	?>
	<LI style="margin-left:5px;"><A href="<?=m_get_config('web_url')."/#";?>"><SPAN><img src="<?=m_get_config('web_url')."/img/catagories/all.png";?>"></SPAN></A></LI>
	<?
	$result3=mysql_query("SELECT * FROM shop_trademarks ORDER BY stt asc");
		while($r3=mysql_fetch_array($result3)){
			//if($r3['stt']== 0 )   {?>				
		<?//  } else{ ?>
			<LI><A href="<?=m_get_config('web_url')."/#";?>"><SPAN><img src="<?=m_get_config('web_url')."/img".$r3['img'];?>"></SPAN></A></LI>
		<?}
}



function noibat()
{
$result3=mysql_query("SELECT * FROM shop_product Where noibat=1 and status=2 ORDER BY id desc limit 5");
		while($r3=mysql_fetch_array($result3)){
					?>
<DIV class=et_pt_gallery_entry>
<DIV class=et_pt_item_image><? if($r3['khuyenmai']==1) { ?>					
					<SPAN class="km"></SPAN>
				<?}?>	<A href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=product';?>">
<IMG class=portfolio 
alt="<?=$r3['ten'];?>" src="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" width=170 height=207>
 <DIV class="portfolio2" style="height:85px;"><center>
<p class="prodes" style="height:35px;"><?=$r3['ten'];?></p>
<p class="price"><?=preg_replace("/,/",".",number_format($r3['gia']));?> vnđ</p>
<p class="status"><? if($r3['status']==2) { echo "Còn Hàng";}  elseif($r3['status']==1) {echo "<font color='orange'>Đang về</font>";} else {echo "<font color='red'>Tạm hết</font>";};?></p>
</center></DIV><SPAN 
class=overlay></SPAN><A class="zoom-icon fancybox" 
title="<?=$r3['ten'];?>" 
href="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" 
rel=gallery>Phóng ảnh</A> <A class=more-icon 
href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=product';?>">Xem</A> </a></DIV><!-- end .et_pt_item_image --></DIV><!-- end .et_pt_gallery_entry -->

		<?}
}




function listpk($id,$mode)
{//hukien Where trademarks=".$id." 
    $result3=mysql_query("SELECT * FROM shop_phukien Where trademarks=".$id." ORDER BY id desc");
		while($r3=mysql_fetch_array($result3)){
					?>
            <DIV class=et_pt_gallery_entry style="padding-left: 22px; padding-top: 15px;"><a style="text-decoration: none;" href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=phukien';?>">
            <DIV class=et_pt_item_image>
                <IMG class=portfolio alt="<?=$r3['ten'];?>" src="<?=m_get_config('web_url').'/img/phukien/'.$r3['hinhanh'];?>" width=170 height=207>
            <DIV class="portfolio2" style="height:85px;"><center>
                    <p class="prodes" style="height:35px;"><?=$r3['ten'];?></p>
                    <p class="price"><?=preg_replace("/,/",".",number_format($r3['gia']));?> vnđ</p>
                    <p class="status">...</p>
            </center></DIV>
                <SPAN class=overlay></SPAN>
                <A class="zoom-icon fancybox" title="<?=$r3['ten'];?>" href="<?=m_get_config('web_url').'/img/phukien/'.$r3['hinhanh'];?>" rel=gallery>Phóng ảnh</A>
                <A class=more-icon href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=phukien';?>">Xem</A> 
            </DIV><!-- end .et_pt_item_image --></a>
        </DIV><!-- end .et_pt_gallery_entry --><? if($r3['khuyenmai']==1) { ?>					
					<SPAN class="km"></SPAN>
				<?}?>

		<?}
}


function comments2($id,$mode)
{//hukien Where trademarks=".$id." 
    $result3=mysql_query("SELECT * FROM shop_".$mode." Where id=".$id." ORDER BY id desc");
		while($r3=mysql_fetch_array($result3)){
					?>            
                <?=$r3['urlcomment'];?>  

		<?}
}


function comments($id,$mode)
{//hukien Where trademarks=".$id." 
    $result3=mysql_query("SELECT * FROM shop_comments Where idsp=".$id." ORDER BY id desc");
		while($r3=mysql_fetch_array($result3)){
					?>            
                <A target="_blank" title="<?=$r3['tieude'];?>" href="<?=m_get_config('url');?>"><?=$r3['tieude'];?></A><br>   

		<?}
}


function phukien()
{
$result3=mysql_query("SELECT * FROM shop_phukien ORDER BY id desc limit 5");
		while($r3=mysql_fetch_array($result3)){
					?>
        <DIV class=et_pt_gallery_entry>
            <DIV class=et_pt_item_image><A  href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=phukien';?>">
                <IMG class=portfolio alt="<?=$r3['ten'];?>" src="<?=m_get_config('web_url').'/img/phukien/'.$r3['hinhanh'];?>" width=170 height=207>
            <DIV class="portfolio2" style="height:85px;"><center>
                    <p class="prodes" style="height:35px;"><?=$r3['ten'];?></p>
                    <p class="price"><?=preg_replace("/,/",".",number_format($r3['gia']));?> vnđ</p>
                    <p class="status"><?=$r3['gia'];?></p>
            </center></DIV>
                <SPAN class=overlay></SPAN>
                <A class="zoom-icon fancybox" title="<?=$r3['ten'];?>" href="<?=m_get_config('web_url').'/img/phukien/'.$r3['hinhanh'];?>" rel=gallery>Phóng ảnh</A>
                <A class=more-icon href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=phukien';?>">Xem</A> 
             </a></DIV><!-- end .et_pt_item_image -->
        </DIV><!-- end .et_pt_gallery_entry --><? if($r3['khuyenmai']==1) { ?>					
					<SPAN class="km"></SPAN>
				<?}?>
<?}
}




function product()
{
$result3=mysql_query("SELECT * FROM shop_product where status=2 ORDER BY id desc limit 5");
    while($r3=mysql_fetch_array($result3)){
					?>
        <DIV class=et_pt_gallery_entry>
            <DIV class=et_pt_item_image><? if($r3['khuyenmai']==1) { ?>					
					<SPAN class="km"></SPAN>
				<?}?>	
				<A href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'];?>">
                <IMG class=portfolio alt="<?=$r3['ten'];?>" src="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" width=170 height=207>
            <DIV style="height:90px;"><center>
                    <p class="prodes" style="height:35px;"><?=$r3['ten'];?></p>
                    <p class="price"><?=preg_replace("/,/",".",number_format($r3['gia']));?> vnđ</p>
                    <p class="status"><? if($r3['status']==2) { echo "Còn Hàng";}  elseif($r3['status']==1) {echo "<font color='orange'>Đang về</font>";} else {echo "<font color='red'>Tạm hết</font>";};?></p>
            </center></DIV>			
			
                <SPAN class=overlay></SPAN>
                <A class="zoom-icon fancybox" title="<?=$r3['ten'];?>" href="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" rel=gallery>Phóng ảnh</A>
                <A class=more-icon href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'];?>">Xem</A> </A> 
            </DIV><!-- end .et_pt_item_image -->
        </DIV><!-- end .et_pt_gallery_entry -->
<?}
}




function view()
{
	?>
<DIV id=service_0 class="tab-slide clearfix">
<DIV class="gallery-area clearfix">
<?  product2(); ?>
</DIV><!-- .gallery-area -->
</DIV><!-- end .tab-slide -->
	<?
	$result31=mysql_query("SELECT * FROM shop_trademarks ORDER BY stt asc");
		while($r31=mysql_fetch_array($result31)){?>
			<DIV id=service_<?=$r31['stt'];?> class="tab-slide clearfix">
<DIV class="gallery-area clearfix">
<?  product1($r31['id']); ?>
</DIV><!-- .gallery-area -->
<A class=readmore href="<?=m_get_config('web_url')."/viewproducts.php?mode=all&id=".$r31['id']."&name=".khongdau($r31['name']);?>"><SPAN>Xem hết</SPAN></A> 
</DIV><!-- end .tab-slide -->
		<?}
}



function product1($id)
{
$result3=mysql_query("SELECT * FROM shop_product where catid=$id ORDER BY id desc limit 5");
    while($r3=mysql_fetch_array($result3)){
					?>
        <DIV class=et_pt_gallery_entry>
            <DIV class=et_pt_item_image><? if($r3['khuyenmai']==1) { ?>					
					<SPAN class="km"></SPAN>
				<?}?>	<A href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=product';?>">
                <IMG class=portfolio alt="<?=$r3['ten'];?>" src="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" width=170 height=207>
            <DIV class="portfolio2" style="height:85px;"><center>
                    <p class="prodes" style="height:35px;"><?=$r3['ten'];?></p>
                    <p class="price"><?=preg_replace("/,/",".",number_format($r3['gia']));?> vnđ</p>
                    <p class="status"><? if($r3['status']==2) { echo "Còn Hàng";}  elseif($r3['status']==1) {echo "<font color='orange'>Đang về</font>";} else {echo "<font color='red'>Tạm hết</font>";};?></p>
            </center></DIV>
                <SPAN class=overlay></SPAN>
                <A class="zoom-icon fancybox" title="<?=$r3['ten'];?>" href="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" rel=gallery>Phóng ảnh</A>
                <A class=more-icon href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=product';?>">Xem</A> 
            </A> </DIV><!-- end .et_pt_item_image -->
        </DIV><!-- end .et_pt_gallery_entry -->
<?}
}



function product2()
{
$result32=mysql_query("SELECT * FROM shop_product where status=2 ORDER BY id desc");
    while($r32=mysql_fetch_array($result32)){
					?>
        <DIV class=et_pt_gallery_entry>
            <DIV class=et_pt_item_image><? if($r32['khuyenmai']==1) { ?>					
					<SPAN class="km"></SPAN>
				<?}?>	<A href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r32['ten']).'&id='.$r32['id'].'&mode=product';?>">
                <IMG class=portfolio alt="<?=$r32['ten'];?>" src="<?=m_get_config('web_url').'/img/product/'.$r32['hinhanh'];?>" width=170 height=207>
            <DIV class="portfolio2" style="height:85px;"><center>
                    <p class="prodes" style="height:35px;"><?=$r32['ten'];?></p>
                    <p class="price"><?=preg_replace("/,/",".",number_format($r32['gia']));?> vnđ</p>
                    <p class="status"><? if($r32['status']==2) { echo "Còn Hàng";}  elseif($r32['status']==1) {echo "<font color='orange'>Đang về</font>";} else {echo "<font color='red'>Tạm hết</font>";};?></p>
            </center></DIV>
                <SPAN class=overlay></SPAN>
                <A class="zoom-icon fancybox" title="<?=$r32['ten'];?>" href="<?=m_get_config('web_url').'/img/product/'.$r32['hinhanh'];?>" rel=gallery>Phóng ảnh</A>
                <A class=more-icon href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r32['id'].'&mode=product';?>">Xem</A> 
            </A> </DIV><!-- end .et_pt_item_image -->
        </DIV><!-- end .et_pt_gallery_entry -->
<?}
}



function old()
{
$result3=mysql_query("SELECT * FROM shop_oldproduct where status=2 ORDER BY id desc limit 15");
    while($r3=mysql_fetch_array($result3)){
					?>
        <DIV class=et_pt_gallery_entry>
            <DIV class=et_pt_item_image>
                <A href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=oldproduct';?>">
				<IMG class=portfolio alt="<?=$r3['ten'];?>" src="<?=m_get_config('web_url').'/img/oldproduct/'.$r3['hinhanh'];?>" width=170 height=207>
            <DIV class="portfolio2" style="height:85px;"><center>
                    <p class="prodes" style="height:35px;"><?=$r3['ten'];?></p>
                    <p class="price"><?=preg_replace("/,/",".",number_format($r3['gia']));?> vnđ</p>
                    <p class="status"><? if($r3['status']==2) { echo "Còn Hàng";}  elseif($r3['status']==1) {echo "<font color='orange'>Đang về</font>";} else {echo "<font color='red'>Tạm hết</font>";};?></p>
            </center></DIV>
                <SPAN class=overlay></SPAN>
                <A class="zoom-icon fancybox" title="<?=$r3['ten'];?>" href="<?=m_get_config('web_url').'/img/oldproduct/'.$r3['hinhanh'];?>" rel=gallery>Phóng ảnh</A>
                <A class=more-icon href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=oldproduct';?>">Xem</A> 
</A>            </DIV><!-- end .et_pt_item_image -->
        </DIV><!-- end .et_pt_gallery_entry -->
		<? if($r3['khuyenmai']==1) { ?>					
					<SPAN class="km"></SPAN>
				<?}?>
<?}
}


function loadads($id)
{
	$result3=mysql_query("SELECT * FROM shop_mainads Where vitri=".$id." and hienthi=1 ORDER BY id desc");
		while($r3=mysql_fetch_array($result3)){
					?>
<!-- Quang Cao -->
<DIV class="main-qc">
<DIV class="container clearfix">
<div class="quangcaocenter"><a href="<?=$r3['url'];?>"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>"></a></div>
</DIV></DIV>
<!-- End Quang Cao -->
		<?}
}


function centerads(){
    $result3=mysql_query("SELECT * FROM shop_centerads Where hienthi=1 ORDER BY id desc limit 1");
	while($r3=mysql_fetch_array($result3)){?>
            <DIV class=blockads>
            <DIV class=blockads-border>
            <DIV class=blockads-content>
            <DIV class="widget">
            <DIV class=widgetcontent>
            <DIV class="imgcenter">
            <a href="<?=$r3['url'];?>"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>"></a>
            </DIV></DIV></DIV>
            </DIV></DIV>
            </DIV>
            <?
        }
}

function topphai(){
    $result3=mysql_query("SELECT * FROM shop_rightslide Where hienthi=1 ORDER BY id desc limit 1");
	while($r3=mysql_fetch_array($result3)){?>
		<DIV class="blockright">
			<DIV class=blockright-border>
				<DIV class=blockright-content>
					<DIV class="widget">
						<DIV class=widgetcontent>		
							<DIV class="imgright">
								<a href="<?=$r3['url'];?>"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width="278px" height="200px"></a>
							</DIV>
						</DIV>
					</DIV><!-- end .widget -->			
				</DIV><!-- end .block-content -->
			</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
            <?
        }
}


function slidetrai(){
    $result3=mysql_query("SELECT * FROM shop_leftads Where hienthi=1 ORDER BY id desc");
	while($r3=mysql_fetch_array($result3)){?>
	<DIV class=slide>
		<A href="<?=$r3['url'];?>">
			<IMG class=thumb alt="<?=$r3['noidung'];?>" src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width=500 height=200> 
		</A>
	</DIV><!-- end .slide -->
            <?
        }
}


function slidephai(){
    $result3=mysql_query("SELECT * FROM shop_rightads Where hienthi=1 ORDER BY id desc");
	while($r3=mysql_fetch_array($result3)){?>
	<DIV class=slideright>
		<A href="<?=$r3['url'];?>">
			<IMG class=thumb alt="<?=$r3['noidung'];?>" src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width=500 height=200> 
		</A>
	<!-- <DIV class=description>
		<H2 class=title2>
			<A href="<?=$r3['url'];?>"><?=$r3['noidung'];?></A>
		</H2>
	</DIV>--><!-- end .description -->
	</DIV><!-- end .slide -->
            <?
        }
}


function newstop(){
    $result3=mysql_query("SELECT * FROM shop_news Where hienthi=1 ORDER BY id desc limit 1");
	while($r3=mysql_fetch_array($result3)){?>
        <DIV class=slidetop>
            <A href="<?=$r3['url'];?>"><IMG class=thumb alt="<?=$r3['tieude'];?>" src="<?=m_get_config('web_url').'/img/righttop/'.$r3['img'];?>" width=461 height=271> </A>
        </DIV><!-- end .slidetop -->
        <DIV class=infocenter>
            <p class="tit"><A href="<?=$r3['url'];?>"><?=$r3['tieude'];?></A></p>
            <p class="noidung"><?=stripslashes($r3['tieude']);?></p>
        </DIV><!-- end .infocenter -->
            <?
        }
}



function newsright(){
    $result3=mysql_query("SELECT * FROM shop_rightnews Where hienthi=1 ORDER BY id desc limit 2");
	?>

	<?
	while($r3=mysql_fetch_array($result3)){?>


		<DIV class="blockright">
			<DIV class=blockright-border>
				<DIV class=blockright-content>
					<DIV class="widget">
						<DIV class="widgetcontent" style="height: 200px;">	
								<div class="box-boxgrid-container">
									<div class="boxgrid caption">
											<a href="<?=$r3['url'];?>"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width="288px" height="208px"></a>
										<div class="cover boxcaption" style="top: 150px; ">
										<div style="padding : 2px;"><h4><A href="<?=$r3['url'];?>"><?=stripslashes($r3["noidung"]);?></A></h4></div>
										</div>		
									</div>
								</div>
					</DIV>
				</DIV><!-- end .widget -->			
				</DIV><!-- end .block-content -->
			</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
            <?
        }
}





function hotroyh()
{
	$result3=mysql_query("SELECT * FROM shop_yahoo ORDER BY id asc limit 4");
	$i=0;
		while($r3=mysql_fetch_array($result3)){
			if($i==0)   {?>
			    <div class="hotro"><center>
					<p><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>"></p>
					<p class="nameht"><?=$r3["name"];?></p>
					<p class="bophan"><?=$r3["bophan"];?></p>
					<p><a href="ymsgr:SendIM?<?=$r3["yahoo"];?>"><img alt="Tư vấn 1: <?=$r3["name"];?>" src="http://opi.yahoo.com/online?u=<?=$r3["yahoo"];?>&amp;m=g&amp;t=1&amp;l=us"/></a></p>
					<p class="bophan">ĐT : 0.<?=preg_replace("/,/",".",number_format($r3["mobile"]));?></p></center>
				</div>			
		<?  } else{ ?>
			    <div class="hotro2 kt<?=$i;?>"><center>
					<p><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>"></p>
					<p class="nameht"><?=$r3["name"];?></p>
					<p class="bophan"><?=$r3["bophan"];?></p>
					<p><a href="ymsgr:SendIM?<?=$r3["yahoo"];?>"><img alt="Tư vấn 1: <?=$r3["name"];?>" src="http://opi.yahoo.com/online?u=<?=$r3["yahoo"];?>&amp;m=g&amp;t=1&amp;l=us"/></a></p>
					<p class="bophan">ĐT : 0.<?=preg_replace("/,/",".",number_format($r3["mobile"]));?></p></center>
				</div>	
		<?}
			$i++;
		}
}



function imgspright(){
    $result3=mysql_query("SELECT * FROM shop_rightnews Where hienthi=1 ORDER BY id desc limit 1");
	while($r3=mysql_fetch_array($result3)){?>
		<DIV class="blockrightsp">
			<DIV class=blockright-border>
				<DIV class=blockright-content>
					<DIV class="widget">
						<DIV class=widgetcontent>		
							<DIV class="imgright2">
								<a href="<?=$r3['url'];?>"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width="278px" height="278px"></a>
							</DIV>
						
					</DIV>
				</DIV><!-- end .widget -->			
				</DIV><!-- end .block-content -->
			</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
            <?
        }
}

/////////////////////////////////////////////////////////////////////  view detail product

function giasp($id, $table){
    $result3=mysql_query("SELECT * FROM $table Where id=$id");
	while($r3=mysql_fetch_array($result3)){?>
		<DIV class="blockgiasp" style="height:319px;">
			<DIV class=blockright-border>
				<DIV class=blockright-content>
					<DIV class="widget">
						<DIV class=widgetcontent>		
							<DIV class="imgright">
							<div style="height:309px;color:#787876;">
								<span style="margin-top:10px;padding:5px; font-size: 16px; color:#787876;line-height: 40px; font-weight: bold;"><?=strtoupper($r3['ten']);?>	</span><br/>
								<span style=" margin-top:10px;padding:5px; font-size: 16px; color:red;line-height: 20px;"><font color="black">Giá:</font> <?=preg_replace("/,/",".",number_format($r3['gia']));?><font color="black"> vnđ</font></span><br>
								<div style="margin-left: 0px; min-height: 10px; width: 276px; border-right: 1px solid #ededed; border-top: 1px solid #ededed;border-left: 1px solid #ededed; margin-top:10px;padding:3px; font-size: 13px; background:#42AB34; color:#fff; line-height: 18px;"><span style='text-transform:uppercase;'><b><center><? if($r3['status']==2) { echo "<font color='#fff'>Còn Hàng</font>";}  elseif($r3['status']==1) {echo "<font color='#fff'>Đang về</font>";} else {echo "<font color='#fff'>Tạm hết</font>";};?></center></b></span></div>
								<div style="margin-left: -3px; min-height: 10px; width: 278px; border-top: 1px solid #ededed;margin-top:10px;padding:3px; font-size: 13px; color:black;line-height: 18px;"><span><font color="green">Phụ Kiện:</font> <?=stripslashes($r3['phukien']);?></span></div>
								<div style="margin-left: -3px; min-height: 10px; width: 278px; border-top: 1px solid #ededed; margin-top:10px;padding:3px; font-size: 13px; color:black;line-height: 18px;"><span><font color="green">Tình Trạng:</font> <?=stripslashes($r3['gioithieu']);?></span></div>
								<div style="margin-left: -3px; min-height: 10px; width: 278px; border-top: 1px solid #ededed;margin-top:10px; padding:5px; font-size: 13px; color:black;line-height: 18px;"><span><font color="green">Bảo Hành:</font> <?=stripslashes($r3['baohanh']);?></span>
								<div id="promotiondetail">
								<div class="left">
								<img src="templates/callconsulting.png" alt="">
								</div>
								<div class="right">
								<p class="txt-p-dt">Tư vấn mua Điện thoại: <br><span class="num-p-dt">098 359 1080</span></p>
								</div>								
								<div class="chuchay">
								<marquee behavior="scroll" direction="left" scrollamount="3">Nếu cần mua Điện thoại, đừng ngần ngại. Hãy gọi ngay cho chúng tôi. </marquee>
								</div>
								</div>
								</div>
							</DIV>
							</DIV>
						</DIV>
					</DIV><!-- end .widget -->			
				</DIV><!-- end .block-content -->
			</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
            <?
        }
}



function anhnhosp($id,$mode){
    $result3=mysql_query("SELECT * FROM shop_$mode Where id=$id");
	while($r3=mysql_fetch_array($result3)){?>
			<DIV class="blockrightsp">
			<DIV class=blockright-border>
				<DIV class=blockright-content>
					<DIV class="widget">
						<DIV class=widgetcontent>		
							<DIV class="imgright2">
								 <iframe width="278" height="200" src="http://www.youtube.com/embed/<?=$r3['anhnho']?>" frameborder="0" allowfullscreen></iframe>  
							</DIV>
						
					</DIV>
				</DIV><!-- end .widget -->			
				</DIV><!-- end .block-content -->
			</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
            <?
        }
}




function tinnhanhphai(){?>
	<DIV class="blockrighttin">
			<DIV class=blockright-border>
				<DIV class=blockright-content>
					<DIV class="widget">
						<DIV class=widgetcontent>		
							<DIV class="imgright3">
							<?
	$result3=mysql_query("SELECT * FROM shop_tinnhanh Where hienthi=1 ORDER BY id desc limit 1");
		while($r3=mysql_fetch_array($result3)){
					?>
		<p>Tin Nhanh: <?=stripslashes($r3["noidung"]);?></p>
		<?       }?>
			</DIV>
						
					</DIV>
				</DIV><!-- end .widget -->			
				</DIV><!-- end .block-content -->
			</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
<?
}



function adssp(){
    $result3=mysql_query("SELECT * FROM shop_qcphai Where hienthi=1 ORDER BY id desc limit 10");
	while($r3=mysql_fetch_array($result3)){?>
		<DIV class="blockright">
			<DIV class=blockright-border>
				<DIV class=blockright-content>
					<DIV class="widget">
						<DIV class=widgetcontent>		
							<DIV class="imgright">
								<a href="<?=$r3['url'];?>"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" width="278px" height="200px"></a>
							</DIV>
						</DIV>
					</DIV><!-- end .widget -->			
				</DIV><!-- end .block-content -->
			</DIV><!-- end .block-border -->
		</DIV><!-- end .block -->
            <?
        }
}



function loadimg($id,$mode)
{
	$result3=mysql_query("SELECT * FROM shop_$mode Where id=$id");
		while($r3=mysql_fetch_array($result3)){	?>
		<?	if($r3["slide1"]!=""){?>
			<img src="<?=stripslashes(m_get_config('web_url').'/img/'.$mode.'/'.$r3["slide1"]);?>" alt="" width="692px" height="520px" />
			<? }
		if($r3["slide2"]!=""){?>
			<img src="<?=stripslashes(m_get_config('web_url').'/img/'.$mode.'/'.$r3["slide2"]);?>" alt="" width="692px" height="520px" />	
			<? }if($r3["slide3"]!=""){?>
			<img src="<?=stripslashes(m_get_config('web_url').'/img/'.$mode.'/'.$r3["slide3"]);?>" alt="" width="692px" height="520px" />			
			<? } if($r3["slide4"]!=""){?>
			<img src="<?=stripslashes(m_get_config('web_url').'/img/'.$mode.'/'.$r3["slide4"]);?>" alt="" width="692px" height="520px" />
		<?} if(($r3["hinhanh"]!="") and ($mode=="phukien")){?>
			<img src="<?=stripslashes(m_get_config('web_url').'/img/phukien/'.$r3["hinhanh"]);?>" alt="" width="692px" height="520px" />
		<?}
		}

}



function chitietphukien($id,$mode)
{
	$result3=mysql_query("SELECT * FROM shop_$mode Where id=$id");
		while($r3=mysql_fetch_array($result3))
			{	
				echo stripslashes($r3["phukientuongthich"]);
			}

}


function chitiet($id,$mode)
{
	$result3=mysql_query("SELECT * FROM shop_$mode Where id=$id");
		while($r3=mysql_fetch_array($result3))
			{	
				if($mode=="phukien"){?>
			<p><?=stripslashes($r3["thongtin"]);?></p>	
			<? 
					}
				else
					{
					?>
			<div style="width: 695px; overflow: hidden;"><p><?=stripslashes($r3["thongtin"]);?></p></div>		
		<?}
					}

}



function qc2ben(){
    $result3=mysql_query("SELECT * FROM shop_qc2ben where hienthi=1 ORDER BY id desc");
	while($r3=mysql_fetch_array($result3)){?>
			<a href="#" target="_blank"><img src="<?=m_get_config('web_url').'/img'.$r3['img'];?>" border="0" width="105px" alt="" /></a><br />
            <?
        }
}


function listsp($id)
{//hukien Where trademarks=".$id." 
    $result3=mysql_query("SELECT * FROM shop_product Where catid=".$id." ORDER BY id desc");
		while($r3=mysql_fetch_array($result3)){
					?>
            <DIV class=et_pt_gallery_entry style="padding-left: 5px; padding-top: 0px;">
			<a style="text-decoration: none;" href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=product';?>">
            <DIV class=et_pt_item_image>
                <IMG class=portfolio alt="<?=$r3['ten'];?>" src="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" width=170 height=207>
            <DIV class="portfolio2" style="height:85px;"><center>
                    <p class="prodes" style="height:35px;"><?=$r3['ten'];?></p>
                    <p class="price"><?=preg_replace("/,/",".",number_format($r3['gia']));?> vnđ</p>
                    <p class="status"><? if($r3['status']==2) { echo "Còn Hàng";}  elseif($r3['status']==1) {echo "<font color='orange'>Đang về</font>";} else {echo "<font color='red'>Tạm hết</font>";};?></p>
            </center></DIV>
                <SPAN class=overlay></SPAN>
                <A class="zoom-icon fancybox" title="<?=$r3['ten'];?>" href="<?=m_get_config('web_url').'/img/product/'.$r3['hinhanh'];?>" rel=gallery>Phóng ảnh</A>
                <A class=more-icon href="<?=m_get_config('web_url').'/viewproducts.php?name='.khongdau($r3['ten']).'&id='.$r3['id'].'&mode=product';?>">Xem</A> 
            </DIV><!-- end .et_pt_item_image --></a>
        </DIV><!-- end .et_pt_gallery_entry -->

		<?}
}

?>